import { ObjCreate } from "../../common/ObjCreate";
import { GTextFormat } from "../../../../common/GTextFormat";
import { HTMLUtil } from "../../../../../com/gengine/utils/HTMLUtil";
import { Language } from "../../../../../extend/language/Language";
import { GlobalStyle } from "../../../../common/global/GlobalStyle";
//class CopyGradeTargetBody
    
    export  class CopyGradeTargetBody /* flash.display.Sprite */
    {
        constructor()
        {
            
            this._targetsText = ObjCreate.createTextField("", 0, 0, 180, 100, this, new GTextFormat(null, 12, null, null, null, null, null, null, null, null, null, null, 3));
            return;
        }

        public updateTargetInfo(arg1: Array<any>, arg2: Array<any>): void
        {
            var loc1=this.createHtmlString(arg1, arg2);
            this._targetsText.htmlText = loc1;
            this._targetsText.height = this._targetsText.textHeight + (arg1.length + arg2.length + 1) * 1;
            return;
        }

        /* internal  */createHtmlString(arg1: Array<any>, arg2: Array<any>): string
        {
            var loc2=null;
            var loc3=0;
            var loc1=HTMLUtil.addColor(Language.getStringByParam(90097, arg2.length.toString()), "#FFFF00");
            loc3 = 0;
            while (loc3 < arg2.length) 
            {
                loc2 = arg2[loc3];
                loc1 = loc1 + HTMLUtil.addColor(loc3 + 1 + "、" + loc2.taskDescribe + "（" + loc2.numPassed + "/" + loc2.markTime + "）\n", GlobalStyle.color1);
                ++loc3;
            }
            loc1 = loc1 + HTMLUtil.addColor(Language.getStringByParam(90098, arg1.length.toString()), "#FFFF00");
            loc3 = 0;
            while (loc3 < arg1.length) 
            {
                loc2 = arg1[loc3];
                loc1 = loc1 + HTMLUtil.addColor(loc3 + 1 + "、" + loc2.taskDescribe + "（" + loc2.markTime + "/" + loc2.markTime + "）\n", GlobalStyle.color1);
                ++loc3;
            }
            return loc1;
        }

        public /* override */ get height(): number
        {
            return this._targetsText.height;
        }

        /* internal */ /* var */_targetsText: Object /* flash.text.TextField */;
    }
